       window.onload = function WebSocketTest() {
           if ("WebSocket" in window) {
               const ws = new WebSocket("ws://127.0.0.1:8080");
               ws.onmessage = function(evt) {
                   if (document.getElementById('mussic')) {
                       document.getElementById('mussic').remove();
                   }
                   const para = document.createElement("audio");
                   const element = document.getElementById("div1");
                   para.id = "mussic";
                   para.src = evt.data;
                   para.autoplay = "autoplay";
                   element.appendChild(para)
               };
               ws.onclose = function() {
                   alert("服务器已关闭");
               };
           }
       }